/*
 * @Author: wangxiaojie
 * @LastEditors: wangxiaojie
 */
const createHistory = require('./history')

const history = createHistory()

history.push({name: 1})
history.push({name: 2})
history.push({name: 3})
history.push({name: 4})

console.log(history.present.name)

history.undo()

console.log(history.present.name)

history.gotoState(0)

console.log(history.present.name)